package guoanmaker.provider.business.model;

import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.ManyToMany;
import javax.persistence.Table;

import com.alibaba.fastjson.annotation.JSONField;
import guoanmaker.provider.helper.common.abstractobj.IdEntity;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Entity
@Table(name="t_provide_role")
public class ProvideRole extends IdEntity {
	private String rolename;
	private String rolecode;
	
	@ManyToMany(mappedBy = "roles")
	@JSONField(serialize=false)
	private Set<ProvideUser> users;
	
	public String authority() {
	    return "ROLE_" + this.rolecode;
	  }

}
